﻿using OASystem.BLL.IService;
using OASystem.Model;
using OASystem.Models;
using OASystem.ViewModel;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;

namespace OASystem.Controllers
{
    public class AhomeController : Controller
    {
        private IAhomeService _ahomeService;
        public AhomeController(IAhomeService ahomeService)
        {
            _ahomeService = ahomeService;
        }
        // GET: Ahome
        public ActionResult Index()
        {
            return View();
        }

        public JsonResult Display()
        {
            ResponseResult result = new ResponseResult();
            Userinfo userinfo = AdminContext.context.adminUser;
            result = _ahomeService.Display(userinfo.UserId);
            List<Taskquery> tq = result.data;
            return Json(tq);
        }

        public JsonResult Select(int Id)
        {
            ResponseResult result = new ResponseResult();
            Userinfo userinfo = AdminContext.context.adminUser;
            result = _ahomeService.Select(userinfo.UserId, Id);
            List<Handle> tq = result.data;
            return Json(tq);
        }
    }
}